package com.tjh.springbootapi.controller;

import com.koala.apiprototype.annotations.IgnoreValidate;
import com.koala.apiprototype.utils.security.PasswordUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 安全相关模块
 */
@RestController
@RequestMapping("/security")
public class SecurityController {

    /**
     * 该方法用于产生MD5加盐加密后的密码值
     *
     * @return
     */
    @IgnoreValidate
    @GetMapping("/getMD5Password")
    public String getMD5Password() {
        String userName = "testMD5Password";
        String password = "123456";
        String md5Password = PasswordUtils.md5(password, userName);
        return md5Password;
    }

}
